(function(){
	Ext.onReady(function(){
		
		Ext.regModel('teacher',{
			fields:[
				{name:'teacherid',type:'int'},
				{name:'name',type:'auto'},
				{name:'age',type:'int'},
				{name:'email',type:'auto'}
			],
			 hasMany: {
		        model: 'student',
		        name : 'getStudent',
		        filterProperty: 'query'
		    }
		});
		
		Ext.regModel('student',{
			fields:[
				{name:'studentid',type:'int'},
				{name:'name',type:'auto'},
				{name:'age',type:'int'},
				{name:'email',type:'auto'},
				{name:'teacher_id',type:'id'}
			]
		})
		
		
	});	
})();